<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/security/tags"
	prefix="security"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<div id="depts" class="btn-group"></div>
<form action="monthplanning/month-planning!importfileplan"
		enctype="multipart/form-data" method="post" target="pdtframe"
		>
		<div class="input-append input-prepend">
		 <span class="add-one"><i class="icon-calendar"></i></span>
			<input class="datepicker" name="actionDate" readonly/> <input type="file"
				name="upLoad" />
			<button class="btn btn-success">导入计划</button>			
		    <button type="button" class="btn btn-info" onclick="planExport()">导出计划</button> 
		</div>		
</form>
<form action="monthplanning/month-planning!downloadcur" target="_blank" id="dlform">
  <input id="adate" name="actionDate" type="hidden"/> 
</form>	

<table class="table table-bordered table-hover">
	<thead>
		<tr>
			<th>名称</th>
			<th width="200">单位</th>
			<th width="100">类型</th>
			<th width="50">状态</th>
			<th width="200">创建日期</th>
			<th width="200">修改日期</th>
			<th width="100">制作者</th>
			<th>管理</th>
		</tr>
		<tr>
			<td colspan="7">
				<button class="btn btn-success" onclick="newOne();">
					<i class="icon-plus"></i>新增计划
				</button>
			</td>
		</tr>
	</thead>
	<tbody>
		<c:forEach items="${pager.rows}" var="item">
			<tr>
				<td>
					<button class="btn btn-small btn-success"
						onclick="showOne('${item.id}');">
						<i class="icon-edit"></i> 编辑
					</button>
				</td>

				<td>${item.department.name}</td>

				<td>${item.planType}</td>
				<td>${item.draftable?"草稿":"执行"}</td>
				<td>${item.createDate}</td>
				<td>${item.updateDate}</td>

				<td>${item.maker.localName}</td>

				<td>
					<button class="btn btn-danger btn-mini"
						onclick="removeOne('${item.id}')">
						<i class="icon-remove icon-white"></i>
					</button>
				</td>
			</tr>
		</c:forEach>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="4">${pager.pagination}</td>
		</tr>
	</tfoot>
</table>
<script type="text/javascript">
	var deptId = "${query.fields[0].value}" || null;
</script>
<script src="scripts/apps/monthplanning/list.js" type="text/javascript"></script>